﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfSnqkGasAnalysis.IData;
using WpfSnqkGasAnalysis.Model;

namespace WpfSnqkGasAnalysis.IData_impl
{
    /// <summary>
    /// 特殊气报告修改日志.数据接口实现
    /// </summary>
    /// 创建时间：2022-12-22 14:53:41。作者：王浩力
    public class Teshu_gas_update_logDAL_impl : BaseDAL, ITeshu_gas_update_logDAL
    {
        public List<Teshu_gas_update_log> GetList(long teshuKEY)
        {
            string sql = " select  *  from  Teshu_gas_update_log  where  teshu_gas_key= "+ teshuKEY;
            return   ExecSqlCmd(sql, null, c => {
                List<Teshu_gas_update_log> list = new List<Teshu_gas_update_log>();
               var reader=c.ExecuteReader();
                while (reader.Read())
                {
                    Teshu_gas_update_log info = new Teshu_gas_update_log();
                    info.Teshu_gas_key = (long)reader["teshu_gas_key"].ToMyInt64();
                    info.Report_no = reader["report_no"].ToString();
                    info.Well_no = reader["well_no"].ToString();
                    info.Well_deep = reader["well_deep"].ToMyDecimal();
                    info.Sample_temperature = reader["sample_temperature"].ToMyDecimal();
                    info.Top_boundary = reader["top_boundary"].ToString();
                    info.Bottom_boundary = reader["bottom_boundary"].ToString();
                    info.Oil_pressure = reader["oil_pressure"].ToMyDecimal();
                    info.Casing_pressure = reader["casing_pressure"].ToMyDecimal();
                    info.Sampling_location = reader["sampling_location"].ToString();
                    info.Client = reader["client"].ToString();
                    info.Sampler = reader["sampler"].ToString();
                    info.Analyst = reader["analyst"].ToString();
                    info.Sampling_unit = reader["sampling_unit"].ToString();
                    info.Sampling_time = reader["sampling_time"].ToString();
                    info.Input_real_name = reader["input_real_name"].ToString();
                    info.Input_user_id = (long)reader["input_user_id"].ToMyInt64();
                    info.Input_time = reader["input_time"].ToString();
                    info.Update_real_name = reader["update_real_name"].ToString();
                    info.Update_time = reader["update_time"].ToString();
                    info.Data_version = (int)reader["data_version"].ToMyInt64();
                    list.Add(info);
                }
                return list;
            });

        }
    }
}
